﻿@using SmartSiteManagementSystem.Models.ProjectManage;
@using SmartSiteManagementSystem.IServices;
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.BodyClass = "easyui-layout";
    DayProjectTypeInfo dayProjectTypeInfo = ViewBag.dayProjectTypeInfo;
}
    <div class="easyui-panel" style="padding:5px;">    
        <input id="DayProjectTypeId" type="hidden" value="@dayProjectTypeInfo.DayProjectTypeId" />
        <table class="gou-formTable" style="align-content:center;">
            <tbody>              
                <tr>
                    <td align="right" class="gou-formTable-title" style="width:160px;">*计划名称:</td>
                    <td align="left" class="">
                         <input id="DayProjectTypeName" name="DayProjectTypeName" type="text" value="@dayProjectTypeInfo.DayProjectTypeName" />    
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">                       
                            <a href="javascript:void(0)" id="hfSave" class="easyui-linkbutton" iconcls="icon-save" onclick="Save();" style="width:150px;height:32px">保存</a>                                           
                    </td>
                </tr>
            </tbody>
        </table>

    </div>



    <script type="text/javascript">        


        //保存
        function Save() {

            //验证必选项******************************************************************
            var DayProjectTypeName = $("#DayProjectTypeName").val();
            if (DayProjectTypeName == "") {
                $.messager.alert('提示', '子计划任务类型名称必填项!');
                return false;
            }
          
            var DayProjectTypeId = $("#DayProjectTypeId").val();
  
            
            var param = { DayProjectTypeId: DayProjectTypeId, DayProjectTypeName: DayProjectTypeName};
            $.ajax({
                "type": "Post",
                "url": "ajaxAddOrEditDayProjectType?t=" + new Date().getTime(),
                "dataType": "json",
                "data": param,
                "success": function (data) {
                    if (data.Code == 1) {
                        window.location.href = "DayProjectTypeIndex";
                    }
                    else
                    {
                         $.messager.alert('提示', data.Msg);
                    }
                }
            });
        }
</script>    
